package com.yanqu.road.entity.activity.hsisland.config;

import com.yanqu.road.utils.string.StringUtils;
import com.yanqu.road.entity.FieldTypeAnnotation;
import org.apache.commons.collections.ListUtils;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_hsisland_event")
public class HsIslandEventConfig {

    @FieldTypeAnnotation(desc = "活动id", select = true, update = true)
    private int activityId;

    @FieldTypeAnnotation(desc = "ID", select = true, update = true)
    private int id;

    @FieldTypeAnnotation(desc = "占地格子参数")
    private String latticeParam;
    private int xNum;//横
    private int yNum;//竖

    @FieldTypeAnnotation(desc = "是否通行")
    private int canTransit;

    @FieldTypeAnnotation(desc = "是否高亮")
    private int isHighlight;

    @FieldTypeAnnotation(desc = "是否公开上报")
    private int isNotice;

    @FieldTypeAnnotation(desc = "个人公告日志文本")
    private String personNoticeText;

    @FieldTypeAnnotation(desc = "商会公告")
    private String guildNoticeText;

    @FieldTypeAnnotation(desc = "起效的buffid")
    private String canWorkBuff;
    private List<Integer> canWorkBuffList = new ArrayList<>();

    @FieldTypeAnnotation(desc = "事件描述")
    private String eventDesc;

    @FieldTypeAnnotation(desc = "事件说明")
    private String eventExplain;

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getLatticeParam() {
        return latticeParam;
    }

    public void setLatticeParam(String latticeParam) {
        this.latticeParam = latticeParam;
        if (!StringUtils.isNullOrEmpty(latticeParam)) {
            String[] strArr = latticeParam.split(";");
            this.xNum = Integer.parseInt(strArr[0]);
            this.yNum = Integer.parseInt(strArr[1]);
        }
    }

    public int getXNum() {
        return xNum;
    }

    public int getYNum() {
        return yNum;
    }

    public int getCanTransit() {
        return canTransit;
    }

    public void setCanTransit(int canTransit) {
        this.canTransit = canTransit;
    }

    public int getIsHighlight() {
        return isHighlight;
    }

    public void setIsHighlight(int isHighlight) {
        this.isHighlight = isHighlight;
    }

    public int getIsNotice() {
        return isNotice;
    }

    public void setIsNotice(int isNotice) {
        this.isNotice = isNotice;
    }

    public String getPersonNoticeText() {
        return personNoticeText;
    }

    public void setPersonNoticeText(String personNoticeText) {
        this.personNoticeText = personNoticeText;
    }

    public String getGuildNoticeText() {
        return guildNoticeText;
    }

    public void setGuildNoticeText(String guildNoticeText) {
        this.guildNoticeText = guildNoticeText;
    }

    public String getCanWorkBuff() {
        return canWorkBuff;
    }

    public void setCanWorkBuff(String canWorkBuff) {
        this.canWorkBuff = canWorkBuff;
        if (!StringUtils.isNullOrEmpty(canWorkBuff) && !canWorkBuff.equals("0")) {
            canWorkBuffList = StringUtils.stringToIntegerList(canWorkBuff, "\\|");
        }
    }

    public List<Integer> getCanWorkBuffList() {
        return canWorkBuffList;
    }

    public String getEventDesc() {
        return eventDesc;
    }

    public void setEventDesc(String eventDesc) {
        this.eventDesc = eventDesc;
    }

    public String getEventExplain() {
        return eventExplain;
    }

    public void setEventExplain(String eventExplain) {
        this.eventExplain = eventExplain;
    }
}
